home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3dm / old-compression / clOpenDemux.z / clOpenDemux
Encoding:
Text File  |  1998-10-20  |  8.6 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ccccllll DDDDeeeemmmmuuuullllttttiiiipppplllleeeexxxxiiiinnnngggg((((3333ddddmmmm))))                                  ccccllll DDDDeeeemmmmuuuullllttttiiiipppplllleeeexxxxiiiinnnngggg((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      clOpenDemux, clDemux, clCloseDemux - Demultiplex into video and audio
  10.      streams
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////ccccllll....hhhh>>>>
  14.  
  15.      iiiinnnntttt ccccllllOOOOppppeeeennnnDDDDeeeemmmmuuuuxxxx((((iiiinnnntttt sssscccchhhheeeemmmmeeee,,,, CCCCLLLLhhhhaaaannnnddddlllleeee ****hhhhaaaannnnddddlllleeeePPPPttttrrrr))))
  16.      iiiinnnntttt ccccllllDDDDeeeemmmmuuuuxxxx((((CCCCLLLLhhhhaaaannnnddddlllleeee hhhhaaaannnnddddlllleeee,,,, iiiinnnntttt ccccoooouuuunnnntttt))))
  17.      iiiinnnntttt ccccllllCCCClllloooosssseeeeDDDDeeeemmmmuuuuxxxx((((CCCCLLLLhhhhaaaannnnddddlllleeee hhhhaaaannnnddddlllleeee))))
  18.  
  19. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  20.      _s_c_h_e_m_e         The demultiplexing scheme to use.
  21.  
  22.      _h_a_n_d_l_e_P_t_r      A pointer to the returned handle of the demultiplexer.
  23.                     Used by subsequent calls to identify the demultiplexer.
  24.  
  25.      _h_a_n_d_l_e         A handle to the demultiplexer.
  26.  
  27.      _c_o_u_n_t          The number of iterations to execute.  The amount of
  28.                     processing done during each iteration is scheme and data
  29.                     dependent.  _c_o_u_n_t may also be specified as
  30.                     CCCCLLLL____CCCCOOOONNNNTTTTIIIINNNNUUUUOOOOUUUUSSSS____BBBBLLLLOOOOCCCCKKKK or CCCCLLLL____CCCCOOOONNNNTTTTIIIINNNNUUUUOOOOUUUUSSSS____NNNNOOOONNNNBBBBLLLLOOOOCCCCKKKK.
  31.  
  32.  
  33. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  34.      ccccllllOOOOppppeeeennnnDDDDeeeemmmmuuuuxxxx opens a demultiplexer for a given scheme.  It is called
  35.      before ccccllllDDDDeeeemmmmuuuuxxxx or any call that requires a demultiplexer handle.
  36.      ccccllllCCCClllloooosssseeeeDDDDeeeemmmmuuuuxxxx closes the demultiplexer after which _h_a_n_d_l_e is no longer
  37.      valid.
  38.  
  39.      ccccllllDDDDeeeemmmmuuuuxxxx takes no buffer arguments so it always invokes the Implicit
  40.      Buffering model (see CLintro(3dm)).  An input buffer of type CL_BUF_MUX,
  41.      and output buffers of types CL_BUF_VIDEO and CL_BUF_AUDIO, must have been
  42.      created previously with ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff.  The input buffer is filled with
  43.      calls to ccccllllQQQQuuuueeeerrrryyyyFFFFrrrreeeeeeee, ccccllllUUUUppppddddaaaatttteeeeHHHHeeeeaaaadddd, and ccccllllDDDDoooonnnneeeeUUUUppppddddaaaattttiiiinnnnggggHHHHeeeeaaaadddd.  The output
  44.      buffers are emptied with calls to ccccllllQQQQuuuueeeerrrryyyyVVVVaaaalllliiiidddd and ccccllllUUUUppppddddaaaatttteeeeTTTTaaaaiiiillll.
  45.  
  46.      Buffers should be appropriately sized for proper execution of ccccllllDDDDeeeemmmmuuuuxxxx.
  47.      The input buffer should have a minimum capacity of CL_MUX_BUFFER_SIZE.
  48.      The output buffers should have minimum capacities of CL_VIDEO_BUFFER_SIZE
  49.      and CL_AUDIO_BUFFER_SIZE. These parameters may be determined by calling
  50.      ccccllllGGGGeeeettttPPPPaaaarrrraaaammmmssss, after first calling ccccllllRRRReeeeaaaaddddHHHHeeeeaaaaddddeeeerrrr to configure the
  51.      demultiplexer.
  52.  
  53.      If _c_o_u_n_t is non-negative, ccccllllDDDDeeeemmmmuuuuxxxx attempts to perform _c_o_u_n_t iterations of
  54.      the demultiplexing operation.  The actual amount of data processed in
  55.      each iteration is scheme and data dependent.  The call to ccccllllDDDDeeeemmmmuuuuxxxx may
  56.      consume up to CL_MUX_BUFFER_SIZE * _c_o_u_n_t bytes of multiplexed data.  This
  57.      may produce up to CL_VIDEO_BUFFER_SIZE * _c_o_u_n_t bytes of video data, and
  58.      up to CL_AUDIO_BUFFER_SIZE * _c_o_u_n_t bytes of audio data.  The call does
  59.      not return until processing is completed.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccllll DDDDeeeemmmmuuuullllttttiiiipppplllleeeexxxxiiiinnnngggg((((3333ddddmmmm))))                                  ccccllll DDDDeeeemmmmuuuullllttttiiiipppplllleeeexxxxiiiinnnngggg((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.      If _c_o_u_n_t is specified as CL_CONTINUOUS_BLOCK or CL_CONTINUOUS_NONBLOCK
  75.      then ccccllllDDDDeeeemmmmuuuuxxxx continues until the input buffer is marked done, or a call
  76.      to ccccllllCCCClllloooosssseeeeDDDDeeeemmmmuuuuxxxx is made.  CL_CONTINUOUS_NONBLOCK differs from
  77.      CL_CONTINUOUS_BLOCK in that the call to ccccllllDDDDeeeemmmmuuuuxxxx returns immediately while
  78.      the demultiplexing occurs in a separate thread.
  79.  
  80.      Several demultiplexers can be open simultaneously.  _h_a_n_d_l_e identifies
  81.      which one is being referenced.
  82.  
  83.  
  84. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
  85.      Each routine returns a negative error code if the call fails.  Upon
  86.      success, ccccllllOOOOppppeeeennnnDDDDeeeemmmmuuuuxxxx and ccccllllCCCClllloooosssseeeeDDDDeeeemmmmuuuuxxxx return SUCCESS, and ccccllllDDDDeeeemmmmuuuuxxxx returns
  87.      either the count actually processed or, in the case of
  88.      CL_CONTINUOUS_NONBLOCK, returns SUCCESS immediately.
  89.  
  90.  
  91. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  92.           #include <dmedia/cl.h>
  93.  
  94.           int paramValueBuffer[][2] = {
  95.               CL_MUX_BUFFER_SIZE, 0,
  96.               CL_VIDEO_BUFFER_SIZE, 0,
  97.               CL_AUDIO_BUFFER_SIZE, 0,
  98.           };
  99.  
  100.           /* Open the demultiplexer */
  101.           clOpenDemux(CL_MPEG1_SYSTEMS_SOFTWARE, &handle);
  102.  
  103.           /* Configure the demultiplexer by reading the header */
  104.           headerSize = clQueryMaxHeaderSize(CL_MPEG1_SYSTEMS_SOFTWARE);
  105.           /* Get the header data from somewhere */
  106.            ...
  107.           clReadHeader(handle, headerSize, header);
  108.  
  109.           /* Allocate buffers of the required size */
  110.           clGetParams(handle, (int *)paramValueBuffer, 6);
  111.           clCreateBuf(handle, CL_BUF_MUX, paramValueBuffer[0][1], 1, NULL);
  112.           clCreateBuf(handle, CL_BUF_VIDEO, paramValueBuffer[1][1], 1, NULL);
  113.           clCreateBuf(handle, CL_BUF_AUDIO, paramValueBuffer[2][1], 1, NULL);
  114.  
  115.           /* Demultiplex a few iterations */
  116.           for(i = 0; i < N; i++)
  117.           {
  118.               /* Keep the input buffer full */
  119.                ...
  120.               clDemux(handle, 1);
  121.               /* Write the video and audio data to somewhere */
  122.                ...
  123.           }
  124.  
  125.           /* Close the demultiplexer */
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ccccllll DDDDeeeemmmmuuuullllttttiiiipppplllleeeexxxxiiiinnnngggg((((3333ddddmmmm))))                                  ccccllll DDDDeeeemmmmuuuullllttttiiiipppplllleeeexxxxiiiinnnngggg((((3333ddddmmmm))))
  137.  
  138.  
  139.  
  140.           clCloseDemux(handle);
  141.  
  142.  
  143.  
  144. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  145.      CLintro(3dm), clReadHeader(3dm), clGetParams(3dm), clCreateBuf(3dm),
  146.      clQueryFree(3dm), clUpdateHead(3dm), clQueryValid(3dm),
  147.      clUpdateTail(3dm), clDoneUpdatingHead(3dm)
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.